package com.itheima;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @Author：shenkunlin
 * @date： 2021/8/18 12:22
 * @Description：
 *  继承MyBatisPlus
 *  1)创建Dao，继承BaseMapper->MyBatisPlus的BaseMapper中提供了单表的增删改查实现
 *  2)创建Service
 *      1：接口->继承IService<T>->MyBatisPlus的IService中提供了单表的增删改查方法定义
 *      2：实现类->继承ServiceImpl<Mapper,T>->MyBatisPlus的ServiceImpl<Mapper,T>中提供了单表的增删改查方法的实现
 *  3)Dao包扫描
 ***/
@SpringBootApplication
@MapperScan(basePackages = "com.itheima.admin.mapper")
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class,args);
    }

    /***
     * mybatisplus分页插件
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }
}
